package com.ydgk.dao;

import com.ydgk.bean.Message;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface MessageMapper {
    @Delete("delete from message where l_lid = #{lid}")
    void deleteByLid(Integer lid);

    @Select("select * from message where l_lid = #{lid} order by mtime desc")
    List<Message> findByLid(Integer lid);

    @Insert("insert into message values(#{mid},#{mtime},#{content},#{l_lid})")
    void insert(Message message);
}
